﻿using System.Windows;
using Microsoft.Phone.Controls;

namespace BalanceManager.UIControls
{
    public class ExtendedLongListSelector : LongListSelector
    {
        public ExtendedLongListSelector()
        {
            SelectionChanged += (sender, args) =>
            {
                SelectedItem = args.AddedItems[0];
            };
        }

        public static readonly DependencyProperty SelectedItemProperty =
            DependencyProperty.Register("SelectedItem", typeof(object), typeof(ExtendedLongListSelector), new PropertyMetadata(default(object)));

        public new object SelectedItem
        {
            get { return GetValue(SelectedItemProperty); }
            set { SetValue(SelectedItemProperty, value); }
        }
    }
}
